﻿@using System.Web.UI.WebControls
@using DevExpress.Web.ASPxGridView
@using DevExpress.Web.Mvc.UI
@using NjamNjam.Model.Entities
@model IEnumerable<VrstaPonude>

@Html.DevExpress().GridView(s =>
{
    s.Name = "gvVrstePonude";
    s.Caption = "Vrste Ponude";
    s.CallbackRouteValues = new {Controller = "Administracija", Action = "gvVrstePonudeCallback"};
    //s.Columns.Add(c => { });
    s.Columns.Add("Naziv", "Naziv");
    //s.SettingsBehavior.AllowGroup = true;
    s.Settings.ShowGroupPanel = false;
    s.SettingsPager.PageSize = 10;
    s.SettingsPager.AlwaysShowPager = true;
    s.Width = Unit.Pixel(300);
    //s.SettingsBehavior.AllowFocusedRow = true;
    //s.Settings.ShowFilterRow = true;
    s.KeyFieldName = "Id";
    //s.ClientSideEvents.FocusedRowChanged = "";
    s.SettingsEditing.Mode = GridViewEditingMode.Inline;
    s.SettingsEditing.NewItemRowPosition = GridViewNewItemRowPosition.Top;
    s.CommandColumn.Visible = true;
    s.CommandColumn.NewButton.Visible = true;
    s.CommandColumn.NewButton.Text = "Novi unos";
    s.CommandColumn.DeleteButton.Visible = true;
    s.CommandColumn.DeleteButton.Text = "Briši";
    s.CommandColumn.EditButton.Visible = true;
    s.CommandColumn.EditButton.Text = "Izmeni";
    s.CommandColumn.CancelButton.Text = "Otkaži";
    s.CommandColumn.UpdateButton.Text = "Sačuvaj";
    s.SettingsEditing.AddNewRowRouteValues = new {Controller = "Administracija", Action = "NovaVrstaPonude"};
    s.SettingsEditing.DeleteRowRouteValues = new { Controller = "Administracija", Action = "ObrisiVrstuPonude" };
    s.SettingsEditing.DeleteRowRouteValues = new { Controller = "Administracija", Action = "AzurirajVrstuPonude" };
}).Bind(Model).GetHtml()